<?php
namespace app\api\logic;
use think\Db;
class Activity extends Base{

    private $AccountInfo = [];

    public function __construct()
    {
        parent::__construct();
    }

    //活动页信息
    public function activityInfo($param)
    {
        $sid = isset($param['sid'])?intval($param['sid']):0; 
        if (!$sid){
            $this->return_data['Msg'] = "无参数";
            return $this->return_data;
        }
        $activity = Db::name('activity')->where([['status','=',1],['sid','=',$sid]])->find();
        $activity['content'] = str_replace('<img', '<img width="100%"', $activity['content']);
        $activity['cover'] = get_newpic_url($activity['pic']); 

        $this->return_data["Code"] = 0;
        $this->return_data["Data"] = ['activity'=>$activity];
        return $this->return_data;
    }

}
